(ns jna.win.oleacc
  (:use jna))

(deflib- oleacc
  (:native ObjectFromLresult [:native mekit.types.win.IID :native :pointer]))
;(defjna :native oleacc ObjectFromLresult) ; return :native or int?

(defn ObjectFromLresult [lResult riid wParam]
  (let [dispatch (jna-new :pointer)
        result (.ObjectFromLresult oleacc lResult riid (native wParam) (address-of dispatch))]
    (when-not (zero? result)
      (throw (Exception. (format "ObjectFromLresult returns %s (0x%x)" result result))))
    (jna-def dispatch)))

